<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" language="javascript" src="__PUBLIC__/Js/jquery-1.9.1.min.js"></script>
</head>
<body>
<form method="get" action="__ACTION__">
	<input type="hidden" value="<?php echo $_GET['ow']?>" name="ow"/> 
	管理员名称：<input type="text" name="an" value="<?php echo $_GET['an'];?>"/><input type="submit" value="提交"/>
</form>

<form action="__URL__/bdel" method="POST">
	<table width="100%" style="">
		<tr>
			<th><input type="checkbox" name="selall">全选</th>
			<th><a href="__ACTION__/ow/<?php if ($_GET['ow']=='desc') echo 'asc'; else echo 'desc';?>/rn/<?php echo $_GET['rn'];?>">ID</a></th>
			<th>管理员名称</th>
			<th>角色</th>
			<th>操作</th>
		</tr>
		<?php foreach ($data as $k => $v):?>
		<tr>
			<td><input name="ids[]" class="delids" type="checkbox" value="<?php echo $v['id'];?>"></td>
			<td><?php echo $v['id'];?></td>
			<td><?php echo $v['username'];?></td>
			<td><?php echo $v['role_name'];?></td>
			<td><a href="__URL__/edit/id/<?php echo $v['id'];?>">修改 </a>
			<?php if ($v['id'] != 1): ?>
			<a onclick="return confirm('确定要删除吗');" href="__URL__/del/id/<?php echo $v['id'];?>">删除</a></td>
			<?php endif?>
		</tr>
		<?php endforeach;?>
		
		<tr colspan="5">
			<td><?php echo $pagestr;?></td>
		</tr>
	</table>
	<input type="submit" value="批量删除">
</form>
<script>
$("input[name=selall]").click(function(){
	//先取出当前checkbox的状态
	var check = $(this).attr("checked");
	//设置所有其他的状态和当前按钮相同
	$(".delids").attr("checked",check);
});

</script>

</body>
</html>
